/**
 * Created by cql-cql-cql on 2017/6/6 0006.
 */
const mongoose = require('mongoose');

//user
var homeworkSchema = new mongoose.Schema({
    name: String,
    download: String,//课件地址
    teacher:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'user'
    },//类型是主键类型，引用的模型是user
    startTime:{
        type: Date,
        default: Date.now()
    },//创建日期
    endTime:{
        type: Date,
        default: Date.now()+1000*60*60*24*7
    },
    info:{
        type: String,
        default: '略'
    },
    student:Array
});

var homeworkModel = mongoose.model('homework', homeworkSchema);


module.exports = homeworkModel